package com.ziytek.web.citizen.util;

import com.ziytek.web.citizen.constant.NumConstant;
import org.apache.commons.lang3.StringUtils;

/**
 * @author fenghx
 * @version 1.0
 * @className CabinetNoUtil
 * Description:
 * @date 2024/3/18 16:19
 */
public class CabinetNoUtil {

    public static String getCabinetNo(String cabinetNo) {
        if (StringUtil.isEmpty(cabinetNo)) {
            return cabinetNo;
        }

        String str = Integer.toHexString(StringUtil.toInt(cabinetNo));
        return str.length() == NumConstant.INT_TWO ? str : StringUtils.leftPad(str, NumConstant.INT_TWO, '0');
    }

}
